package com.myyl.springcloudprovider.service;

import com.myyl.springcloudprovider.pojo.User;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Author: myyl
 * @Time: 2019/7/19 - 22:18
 * @Description:
 */

@Service
public class UserService {

    private static Map<String, User> users = new HashMap<>();

    static {

        users.put("1", new User("1", "钻石", 24));
        users.put("2", new User("2", "水晶", 14));
        users.put("3", new User("3", "翡翠", 20));
        users.put("4", new User("4", "珍珠", 18));
        users.put("5", new User("5", "蓝玉", 13));
        users.put("6", new User("6", "象牙", 12));
        users.put("7", new User("7", "黄金", 16));
    }

    public User getUserById(String id) {
        return users.get(id);
    }

}
